﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraBars;

namespace DrugsShopManagement
{
    public partial class RibbonFrmMain : DevExpress.XtraBars.Ribbon.RibbonForm
    {
        public RibbonFrmMain()
        {
            InitializeComponent();
        }

        public FrmUsers frmUsers;
        public FrmChangePwd frmChangePwd;
        public FrmPowerManage frmPowerManage;
        public FrmReportDesign frmReportDesign;
        public FrmDrugsInfo frmDrugsInfo;
        public FrmDrugsProvider frmDrugsProvider;
        public FrmDrugsBuy frmDrugsBuy;
        public FrmDrugsSales frmDrugsSales;
        public FrmDrugsIn frmDrugsIn;
        public FrmDrugsOut frmDrugsOut;
        public FrmDrugsBuySearch frmDrugsBuySearch;

        private void navBarItem1_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            FrmLogin f = new FrmLogin();
            f.Show();
        }

        private void barButtonItem27_ItemClick(object sender, ItemClickEventArgs e)
        {
            if (frmReportDesign == null || frmReportDesign.IsDisposed)
            {
                frmReportDesign = new FrmReportDesign();
                frmReportDesign.MdiParent = this;
                //this.xtraTabPage1.Text = frmReportDesign.Text.ToString();
                frmReportDesign.TopMost = true;
                frmReportDesign.Show();
            }
            if (frmReportDesign!=null)
            {
                frmReportDesign.Activate();
            }
        }

        private void barButtonItem25_ItemClick(object sender, ItemClickEventArgs e)
        {
            Application.Exit();
        }

        private void RibbonFrmMain_Load(object sender, EventArgs e)
        {
            this.WindowState = FormWindowState.Maximized;
        }

        private void barButtonItem26_ItemClick(object sender, ItemClickEventArgs e)
        {
            FrmAbout fa = new FrmAbout();
            fa.ShowDialog();
            fa.Dispose();
        }

        private void barButtonItem11_ItemClick(object sender, ItemClickEventArgs e)
        {
       
        }

        private void barButtonItem7_ItemClick(object sender, ItemClickEventArgs e)
        {
            if (frmDrugsInfo == null || frmDrugsInfo.IsDisposed)
            {
                frmDrugsInfo = new FrmDrugsInfo();
                frmDrugsInfo.MdiParent = this;
                frmDrugsInfo.Show();
            }
            if (frmDrugsInfo!=null)
            {
                frmDrugsInfo.Activate();
            }
        }
    }
}